package com.fanjun.learning.multithread.ATM;

/**
 * Created by memedai on 2016/10/13.
 */
public class DepositThread extends Thread{

    private final ATM atm;

    public DepositThread(String name, ATM atm) {
        super(name);
        this.atm = atm;
    }

    @Override
    public void run(){
        for (int i = 0; i < 100; i++){
            atm.deposit();
            try {
                sleep(500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
